<?php
class Vs_Question_Table
	extends Vs_Table 
	
{
	protected $_name = 'Questions';
	protected $_primary = 'questionId';
    
    protected $_keys = array(
        'questionId' => Zend_Db::INT_TYPE,
        'name'   => null,
        'status'   => Zend_Db::INT_TYPE,
        'categoryId'   => Zend_Db::INT_TYPE,
        'startDate'   => null,
        'endDate'   => null,
        'cityId'   => Zend_Db::INT_TYPE,
        'reasonFamilyId'   => Zend_Db::INT_TYPE,
        'description'   => Zend_Db::INT_TYPE
    );
    
    protected $_nulls = array('categoryId','cityId','reasonFamilyId');
    
    public function getTop()
    {
    	return $this->_db->fetchAssoc(
    		$this->select()->group("categoryId")->limit(6)		
    	);
    }
}
